<template>
	<view class="node-box">
		<view class="step-item" v-for="(item,i) in nodeList" :key="i">
			<view class="node-info">
				<uni-icons type="checkbox-filled" color="#00B578" :size="20"></uni-icons>
				<text class="node-info-title">{{item.auditUserName}}--{{item.nodeType}}</text>
				<text :class="item.statu == 1?'item-pass':'item-return'">{{item.statu == 1 ? '通过':'不通过'}}</text>
			</view>
			<view class="step-time" :class="i < nodeList.length-1 ? 'step-line' : ''">
				<view style="margin-bottom: 20rpx;">备注：{{item.auditRemark}}</view>
				<text>{{getTime(item.auditTime)}}</text>
				<!-- <view v-if="i == 2">
					<sub-steps></sub-steps>
				</view>
				<view class="">
					<step-file v-if="i == 3"></step-file>
				</view> -->
			</view>
		</view>
	</view>
</template>

<script>
	import SubSteps from '@/components/SubSteps.vue'
	import StepFile from '@/components/StepFileBox.vue'
	export default {
		name:"Stepsbox",
		data() {
			return {
				// nodeList: [{
				// 	title: '已受理',
				// 	desc: '2018-11-11'
				// }, {
				// 	title: '已初审',
				// 	desc: '2018-11-12'
				// }, {
				// 	title: '已审核',
				// 	desc: '2018-11-13'
				// }, {
				// 	title: '已验收',
				// 	desc: '2018-11-14'
				// },
				// // {
				// // 	title: '费用结算',
				// // 	desc: '2018-11-14'
				// // },
				// {
				// 	title: '已完结',
				// 	desc: '2018-11-14'
				// }]
			};
		},
		props:{
			nodeList:{
				default:[],
				typeof:Array
			}
		},
		components: {
			SubSteps,
			StepFile,
		},
		methods: {
			getTime(val) {
				if (val) {
					const date = new Date(val);
					const formattedDate = date.toLocaleString();
					return formattedDate
				} else{
					return ''
				}
				
			}
		},
	}
</script>

<style lang="scss">
	.item-pass{
		background-color: #00B578;
		color: #fff;
		font-size: 20rpx;
		padding: 0rpx 20rpx;
		border-radius: 24rpx;
		margin-left: 20rpx;
	}
	.item-return{
		background-color: red;
		color: #fff;
		font-size: 20rpx;
		padding: 0rpx 20rpx;
		border-radius: 24rpx;
		margin-left: 20rpx;
	}
	.node-box{
		background-color: #fff;
	}
	.node-info{
		display: flex;
		align-items: center;
	}
	.node-info-title{
		font-size: 29rpx;
		color: #333333;
		line-height: 22rpx;
		margin-left: 35rpx;
	}
	.step-line{
		border-left: solid 3rpx #00B578;
		
	}
	.step-time{
		font-weight: 400;
		font-size: 28rpx;
		color: #888888;
		line-height: 22rpx;
		padding-bottom: 55rpx;
		padding-left: 54rpx;
		margin-left: 18rpx;
		padding-top: 12rpx;
	}
</style>